package com.katze.boot.file.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.katze.common.DatePattern;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 说  明：
 * 作  者：admin
 * 日  期：2023-12-07
 */
@Data
@TableName("sys_file_database_folder")
public class FolderEntity implements Serializable {
    private static final long serialVersionUID = -5141140423650521202L;

    @TableId(value = "id", type = IdType.ASSIGN_UUID)
    private String id;

    /**
     * 文件库的id
     */
    private String fileDatabaseId;

    /**
     * 文件夹的名称
     */
    private String name;

    /**
     * 创建时间
     */
    private Date createTime;

    @TableField(exist = false)
    private transient String path;

    public FolderEntity() {}

    public FolderEntity(String fileDatabaseId) {
        this.fileDatabaseId = fileDatabaseId;
        this.name = DatePattern.YY_PURE_DATETIME_MS_FORMAT.format(new Date());
        this.createTime = new Date();
    }
}
